rvest package. You can find more information about the package here.
# loading package
library(rvest)
## Loading required package: xml2
TablePath <- "/html/body/div[3]/div[3]/div[5]/div[1]/table[1]"
read_html(), html_nodes() and html_table() functions. You can read more about them in the Help panel in RStudio or by calling them preceded by a question mark (e.g., ?read_html()).
# Setting URL
url <- "https://en.wikipedia.org/wiki/List_of_most-liked_YouTube_videos"
# Reading HTML from URL
html <- read_html(url)
# Navigating to the HTML node with the table object
Node <- html_nodes(html, xpath = TablePath)
# Extracting the table and assigning it to an R object
Table <- html_table(Node)
# Unlisting the dataframe
YouTubeData <- Table[[1]]